cleanup.Register("Warmelon Props")
local function BuildAdminControlPanel( Panel )

local ded = 1

	Panel:AddControl( "Header", { Text = "WarMelons:RTS Control Panel", Description = "WarMelons:RTS Control Panel" }  )
	
	local params = {}
	params.Label = "#Cost Multiplier for Generators"
	params.Type = "Integer"
	params.Min = "0"
	params.Max = "10"
	if ded == 1 then
	params.Command = "WM_Cost"
	else
	params.Command = "rcon WM_Cost"
	end
	Panel:AddControl( "Slider",params)

	local params = {}
	params.Label = "#Build Time Multiplier for Generators"
	params.Type = "Integer"
	params.Min = "0"
	params.Max = "10"
	if ded == 1 then
	params.Command = "WM_Time"
	else
	params.Command = "rcon WM_Time"
	end
	Panel:AddControl( "Slider",params)

	local params = {}
	params.Label = "#Cost Mutliplier for Tools"
	params.Type = "Integer"
	params.Min = "0"
	params.Max = "10"
	if ded == 1 then
	params.Command = "WM_Toolcost"
	else
	params.Command = "rcon WM_Toolcost"
	end
	Panel:AddControl( "Slider",params)

	local params = {}
	params.Label = "#Build Radius (0 for none)"
	params.Type = "Integer"
	params.Min = "0"
	params.Max = "5000"
	if ded == 1 then
	params.Command = "WM_Buildradius"
	else
	params.Command = "rcon WM_Buildradius"
	end
	Panel:AddControl( "Slider",params)

	local params = {}
	params.Label = "#Cost Mutliplier for Props"
	params.Type = "Integer"
	params.Min = "0"
	params.Max = "10"
	if ded == 1 then
	params.Command = "WM_Propcost"
	else
	params.Command = "rcon WM_Propcost"
	end
	Panel:AddControl( "Slider",params)

	local params = {}
	params.Label = "#NRG from Tiberium"
	params.Type = "Integer"
	params.Min = "0"
	params.Max = "10"
	if ded == 1 then
	params.Command = "WM_TiberiumNRG"
	else
	params.Command = "rcon WM_TiberiumNRG"
	end
	Panel:AddControl( "Slider",params)

	local params = {}
	params.Label = "#Starting NRG per player"
	params.Type = "Integer"
	params.Min = "0"
	params.Max = "1000000"
	if ded == 1 then
	params.Command = "WM_StartingNRG"
	else
	params.Command = "rcon WM_StartingNRG"
	end
	Panel:AddControl( "Slider",params)

	local params = {}
	params.Label = "#Speed Multiplier for Melons"
	params.Type = "Integer"
	params.Min = "0"
	params.Max = "10"
	if ded == 1 then
	params.Command = "WM_Melonspeed"
	else
	params.Command = "rcon WM_Melonspeed"
	end
	Panel:AddControl( "Slider",params)

	local params = {}
	params.Label = "#Approximate Melon Drowning Time in Seconds"
	params.Type = "Integer"
	params.Min = "0"
	params.Max = "500"
	if ded == 1 then
	params.Command = "WM_Drowntime"
	else
	params.Command = "rcon WM_Drowntime"
	end
	Panel:AddControl( "Slider",params)

	local params = {}
	params.Label = "#NRG from Cappoints"
	params.Type = "Integer"
	params.Min = "0"
	params.Max = "10000"
	if ded == 1 then
	params.Command = "WM_Cappointnrg"
	else
	params.Command = "rcon WM_Cappointnrg"
	end
	Panel:AddControl( "Slider",params)

	local params = {}
	params.Label = "#Enable Normal Propspawning"
	params.Type = "Boolean"
	if ded == 1 then
	params.Command = "WM_Normalpropspawning"
	else
	params.Command = "rcon WM_Normalpropspawning"
	end
	Panel:AddControl( "Checkbox",params)
	
end

local function AddWarMelonsRTSAdminControlPanelMenu()
	spawnmenu.AddToolMenuOption( "Utilities", "WarMelonsRTS", "WarMelonsRTSAdminControlPanel", "WarMelonsRTSAdminControlPanel", "", "", BuildAdminControlPanel, {} )
end
hook.Add( "PopulateToolMenu", "AddWarMelonsRTSAdminControlPanelMenu", AddWarMelonsRTSAdminControlPanelMenu )
